import { createRouter, createWebHistory } from 'vue-router'
import KnowledgeList from '../views/KnowledgeList.vue'
import KnowledgeBase from '../views/KnowledgeBase.vue'
import Search from '../views/Search.vue'
import KnowledgeTest from '../views/KnowledgeTest.vue'
import FileManager from '../views/FileManager.vue'

const routes = [
  {
    path: '/',
    redirect: '/knowledge'
  },
  {
    path: '/knowledge',
    name: 'KnowledgeList',
    component: KnowledgeList
  },
  {
    path: '/knowledge/:id/test',
    name: 'KnowledgeTest',
    component: KnowledgeTest
  },
  {
    path: '/knowledge/:id/dataset',
    name: 'KnowledgeDataset',
    component: KnowledgeBase
  },
  {
    path: '/knowledge/:id/settings',
    name: 'KnowledgeSettings',
    component: KnowledgeBase
  },
  {
    path: '/knowledge/:id',
    name: 'KnowledgeDetail',
    component: KnowledgeBase,
  },
  {
    path: '/search',
    name: 'search',
    component: Search
  },
  {
    path: '/files/:pathMatch(.*)*',
    name: 'files',
    component: FileManager
  }
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes
})

export default router 